package schedules;

import java.sql.SQLException;
import java.util.Date;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobKey;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.component.beans.CalendarioBeans;

public class CalendarioJob implements Job {

    private static Logger _log = LoggerFactory.getLogger(CalendarioJob.class);

    /**
     * Empty constructor for job initialization
     */
    public CalendarioJob() {
    }

    
    public void execute(JobExecutionContext context)
        throws JobExecutionException {

        // This job simply prints out its job name and the
        // date and time that it is running
    	CalendarioBeans calen = new CalendarioBeans();
    	try {
			calen.getCalendario();
		} catch (SQLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
    	
    	
        JobKey jobKey = context.getJobDetail().getKey();
        _log.info("CalendarioJob says: " + jobKey + " executing at " + new Date());
        
    }
}
